A Log-Structured File System (LSFS) is a file system which writes data and/or metadata sequentially to a buffer. As write, delete, and other requests which modify data are received at the LSFS, the LSFS will allocate new memory blocks and create new copies of the adjusted data, while retaining the previous copy of the unadjusted data. In this manner, the LSFS retains copies of past versions of files while introducing modifications in new memory. A storage system implementing an LSFS may include one or more storage devices configured to receive information and from which information may be obtained. The LSFS may be implemented in accordance with various storage architectures, e.g., a network-attached storage environment, a storage area network and a disk assembly directly attached to a client or host computer. An example of an LSFS that is also a write-anywhere file system that is configured to operate on a storage system is the Write Anywhere File Layout (WAFL®) file system available from Network Appliance, Inc., of Sunnyvale, Calif.
The LSFS may include a consistency check program (e.g. Unix fsck, WAFL Wafliron, etc.) that makes changes to the file system to correct inconsistencies therein. In many instances, users cannot verify the consistency of their data until after the consistency check program has completed. By that time, the consistency check program's changes may have been implemented upon the file system and may be irreversible. If the consistency check program has made any errors or introduced even further inconsistencies, the user will be without remedy to correct them. This may be particularly troublesome in an LSFS where the LSFS, by design, does not permit the user access to the retained copies of file data prior to its modification. Thus, despite the regular retention of historical data, the LSFS may render such data inaccessible for recovery purposes.
Additionally, many consistency check programs store their temporary run-time data on disks, possibly disks on a different file system than the one being checked. When there is no other file system available upon which to store this data (e.g., in single aggregate systems), these programs may save the data upon the same file system being checked. This approach can be dangerous, as the blocks allocated to user data can be inadvertently used by the consistency check program for its temporary data. The consistency check program may overwrite valuable user-data. However, setting aside a dedicated local storage to be used by the file system check program may be costly and inefficient.
Accordingly, there exists a need for a system facilitating file system consistency checks in an LSFS without jeopardizing the integrity of user data. A new approach for converting the on-disk image of the file system to safe and recoverable format prior to the consistency check is desired.